package main

import (
	"fmt"
	"reflect"
)

//课堂练习
//将一个float变量 获取Value Type Kind ，将Value转换为interface{} 将interface{}转换为float
func main() {
	var num1 float32 = 10.1
	rVal := reflect.ValueOf(num1)
	rType := rVal.Type()
	rKind := rVal.Kind()

	fmt.Println(rVal)
	fmt.Println(rType)
	fmt.Println(rKind)

	iVal := rVal.Interface()
	result, ok := iVal.(float32)
	if !ok {
		fmt.Println("转换失败")
		return
	}
	fmt.Println(result)
}
